<?php
class Text extends IController{
    public function add()
    {
        $this->redirect("add");
    }
    public function add_do()
    {
        $model = new IModel('new');
        $name = IFilter::act(IReq::get('name','post'));
        $pwd = IFilter::act(IReq::get('pwd','post'));
       $data_info = array(
          'name' => $name,
           'pwd' => $pwd,
       );
//       print_r($data_info);die;
       $model->setData($data_info);
       $res=$model->add();
       if($res)
       {
//           echo "<script>alert('注册成功');location.href='show';</script>";
           $this->redirect("show");
       }


    }
    public function show()
    {
        $model = new IModel('new');
        $data = $model->query();
        $this->data = $data;
        $this->redirect("show");

    }

    public function qq_do()
    {
        $appid='101353491';			// APPID
        $appkey='df4e46ba7da52f787c6e3336d30526e4';			// APPKEY
        $redirect_uri='http://www.iwebshop.com/index.php';		// 回调地址
        $state = rand(1000,9999);
        $url = "https://graph.qq.com/oauth2.0/authorize?response_type=code&client_id=$appid&redirect_uri=$redirect_uri&state=$state";
        header("Location:$url");
    }


}
?>